package com.guanyong.www.maoyanDemo;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/9/12 0012.
 */
public class MaoyanData {
    public String movieid;
    public String movieName;
    public String daoyan;
    public int daoyanId;
    public String yanyuan;
    public int yanyuanId;
    public String yanyuan2;
    public int yanyuan2Id;
    public int type1;
    public String type1Nname;
    public int type2;
    public String type2Nname;
    public String zhizuo;
    public int zhizuoId;
    public String chupin;
    public int chupinId;
    public float ljzhbox;

    private static Map<String,Integer> typeMap;
    public static int getTypeName(String typeNum){
            if (typeMap==null){
                typeMap=new HashMap<String, Integer>();
                typeMap.put("爱情",20);
                typeMap.put("喜剧",21);
                typeMap.put("动画",22);
                typeMap.put("剧情",23);
                typeMap.put("恐怖",24);
                typeMap.put("惊悚",25);
                typeMap.put("科幻",26);
                typeMap.put("动作",27);
                typeMap.put("悬疑",28);
                typeMap.put("犯罪",29);
                typeMap.put("冒险",30);
                typeMap.put("奇幻",31);
                typeMap.put("运动",32);
                typeMap.put("家庭",33);
                typeMap.put("古装",34);
                typeMap.put("武侠",35);
                typeMap.put("西部",36);
                typeMap.put("历史",37);
                typeMap.put("传记",38);
                typeMap.put("情色",39);
                typeMap.put("歌舞",40);
                typeMap.put("黑色电影",41);
                typeMap.put("短片",42);
                typeMap.put("纪录片",43);
                typeMap.put("其他",44);
            }
        return typeMap.get(typeNum);
    }

    public  String toString(){
        return movieid+"\t"+movieName+"\t"+daoyan+"\t"+yanyuan+"\t"+yanyuan2+"\t"+getTypeName(String.valueOf(type1))+"\t"+getTypeName(String.valueOf(type2))+"\t"+zhizuo+"\t"+chupin+"\t"+ljzhbox+"\t"+type1+"\t"+type2+"\t"+daoyanId+"\t"+yanyuanId+"\t"+yanyuan2Id+"\t"+zhizuoId+"\t"+chupinId;
    }


    public boolean check(){
        if (type1>0&&type2>0&&daoyan!=null&&yanyuan2!=null&&zhizuo!=null){
            return true;
        }
        return false;
    }

    public boolean check2(){
        if (type1>0&&type2>0&&daoyanId>0&&yanyuan2Id>0&&zhizuoId>0){
            return true;
        }
        return false;
    }
}
